/* 
 * File:   Point.h
 * Author: Muhammad Anis
 */
#include "../Utilities/boolean.h"
#include <stdio.h>

#ifndef POINT_H
#define	POINT_H

typedef struct{
    double x;
    double y;
} Point;
/**
 * Create Point from given (x,y)
 * @param x X Coordinate
 * @param y Y Coordinate
 */
Point MakePoint(double x,double y);

/**
 * I.S : Independent
 * F.S : Write Point Value to screen
 * @param p Given Point
 */
void PrintPoint(Point p);

/**
 * Check if a point is less than other point
 * A point is less than other if P1.x < P2.x && P1.y<P2.y
 * @param p1 First point
 * @param p2 Second point
 * @return true jika p1 < p2
 */
double isLessThan(Point p1,Point p2);

/**
 * I.S : Independent
 * F.S : P is moved to x+deltaX and y+deltaY
 * @param p Given Point
 */
void Move(Point* p,double deltaX, double deltaY);

/**
 * Check if a point is on its origin
 * @param p Given point
 * @return true if coordinate of p is (0,0)
 */
double isOrigin(Point p);

/**
 * Get Absis Part of given point
 * @param p Given Point
 * @return Absis of point
 */
double GetAbsis(Point p);

/**
 * Get Y Part of given Point
 * @param P Given point
 * @return Ordinat of a Point
 */
double GetOrdinat(Point P);

/**
 * I.S : Independent
 * F.S : Absis of P value is set to x
 * @param p Given Point
 * @param x New Absis value
 */
void SetAbsis(Point *p, double x);

/**
 * I.S : Independent
 * F.S : Ordinat of P value is set to y
 * @param p Given Point
 * @param y new Ordinat value
 */
void SetOrdinat(Point *p, double y);

/**
 * Check if a point is equal with another point
 * @param p1 First point
 * @param p2 Second point
 * @return true if P1.x = P2.x && P1.x = P2.x
 */
double EqPoint(Point p1,Point p2);

/**
 * Move Point to its mirror position
 * @param p Given Point
 * @return Point which has coordinate as result of p point mirror
 */
Point Mirrorof(Point p);

/**
 * I.S : Independent
 * F.S : Move p to mirror Position
 * @param p Given Point
 */
void MirroringPoint (Point *p);
#endif	/* POINT_H */

